/**
 * Huisou.com Inc.
 * Copyright (c) 2011-2012 All Rights Reserved.
 */

package com.chenzehe.hadoop.test;

import java.io.IOException;
import java.net.URI;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;

/**
 * @description
 * 
 * @author chenzehe
 * @email hljuczh@163.com
 * @create 2013-8-9 上午11:46:30
 */

public class FileSystemDelete {
	public static void main(String[] args) {
		Configuration conf = new Configuration();
		String hdfsPath = "hdfs://192.168.0.2:49000/user/hadoop/mvnrepo.rar";
		FileSystem fs = null;
		try {
			fs = FileSystem.get(URI.create(hdfsPath), conf);
			fs.delete(new Path(hdfsPath), true);
		}
		catch (IOException e) {
			e.printStackTrace();
		}
		finally {
			IOUtils.closeStream(fs);
		}
	}
}
